//集中管理用户相关的异步请求
import request from '../utils/request'

export const getCitys = ()=>{
  return request.get('/local/city')
}

export const addressAdd = (addressObj)=>{ //新增收货地址
  return request.post('/local/address',addressObj)
}

export const addressGet = (userid)=>{ //获取收货地址,真实业务逻辑中，应该以用户id查询收货地址数据表
  return request.get('/local/address')
}

export const userReg = (user)=>{ //注册
  return request.post('/node/users',user)
}

export const userLogin = (user)=>{ //登录
  return request.get('/node/users',{
    params:user
  })
}

export const userUpdate = (userid,user)=>{ //更新用户信息
  return request.put(`/node/users?_id=${userid}`,user)
}

export const stuGet = ()=>{ //获取学员信息
  return request.get('/node/stu')
}